<?php

namespace App\Http\Controllers;

use Faker\Factory;
use Illuminate\Http\Request;

class ArticleController extends Controller
{
    public function show($id)
    {
        if (is_numeric($id)) {
            $id = Factory::create()->name();
        }

        $i = 0;
        $data = [];
        $arr = array_pad([], 5, $id);
        do {
            $data[] = $arr;
            $i++;
        } while ($i <5);

        return view(resolveView(__CLASS__, __FUNCTION__))->with([
            'id' => $id,
            'data' => $data,
        ]);
    }
}
